package wavedigest.data;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.google.appengine.api.datastore.Key;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class EmailRegistration
{
	public static final int SCHEDULE_TYPE_EVERY_CHANGE = 0;
	public static final int SCHEDULE_TYPE_HOURLY = 1;
	public static final int SCHEDULE_TYPE_DAILY = 2;
	public static final int SCHEDULE_TYPE_WEEKLY = 3;

	public static final int SCHEDULE_TYPE_UNSUBSCRIBE = 4;
	
	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Key key;

	@Persistent
	private String emailAddress;
	
	@Persistent
	private int scheduleType;
	
	@Persistent
	private RegisteredWave registeredWave;
	
	public EmailRegistration(String emailAddress, int scheduleType)
	{
		this.emailAddress = emailAddress;
		this.scheduleType = scheduleType;
	}

	public String getEmailAddress()
	{
		return emailAddress;
	}

	public void setEmailAddress(String emailAddress)
	{
		this.emailAddress = emailAddress;
	}

	public int getScheduleType()
	{
		return scheduleType;
	}

	public void setScheduleType(int scheduleType)
	{
		this.scheduleType = scheduleType;
	}

	public void setRegisteredWave(RegisteredWave registeredWave)
	{
		this.registeredWave = registeredWave;
	}

	public RegisteredWave getRegisteredWave()
	{
		return registeredWave;
	}

	public void setKey(Key key)
	{
		this.key = key;
	}

	public Key getKey()
	{
		return key;
	}
}

